using System;
using System.Collections;
using System.Collections.Generic;
using FrameWork;
using UnityEngine;

public class SystemTipsManager : MonoBehaviour
{
    [SerializeField] private GameObject content;
    private void Start()
    {
        EventSystem.Instance.AddListener<string>(EventName.EVENT_SYSTEM_ADD_TIPS, AddTips);
    }

    private void OnDisable()
    {
        EventSystem.Instance.RemoveListener<string>(EventName.EVENT_SYSTEM_ADD_TIPS, AddTips);
    }

    private void AddTips(string tips)
    {
        // 创建Tips预制体
        GameObject tip = ObjectPool.Instance.Spawn("Tip");
        tip.transform.SetParent(content.transform);
        tip.GetComponent<Tip>().SetTip(tips);
    }
}
